/*
 * NeighListB.h
 *
 *  Created on: 9 Aug 2011
 *      Author: marchi
 */

#ifndef NEIGHLISTB_H_
#define NEIGHLISTB_H_

#include <list>
struct NonSortable{
	int n;
};
struct Sortable{
	int n;
	float dist;
};


template <class T>
class NeighListB: public std::list<T> {
public:
	NeighListB(){};
	virtual ~NeighListB(){this->clear();};
	void mysort();
private:
	static bool compare(T &, T &);
};

template<>
inline bool NeighListB<Sortable>::compare(Sortable & x, Sortable & y){
	return x.dist<y.dist;
}

template<>
inline void NeighListB<Sortable>::mysort(){
	this->sort(compare);
}

#endif /* NEIGHLISTB_H_ */
